//
//  PreferencesTableAddCall.m
//  iMarks
//
//  Created by Christian Speich on 21.12.07.
//  Copyright 2007-2008 Christian Speich. All rights reserved.
//

#import "NewDeleteRefresh.h"


@implementation NewDeleteRefresh

- (id) initNewCellWithGroup:(int)i andLocation:(int) i2 andRange:(int)i3
{
	self = [super init];
	if (self != nil) {
		group = i;
		index = i2;
		range = i3;
	}
	return self;
}

- (id) initDeleteCellWithGroup:(int)i andLocation:(int) i2 andRange:(int)i3
{
	self = [super init];
	if (self != nil) {
		group = i;
		index = i2;
		range = i3;
	}
	return self;
}

- (id) initRefreshWithArray:(NSArray*)array
{
	self = [super init];
	if (self != nil) {
		refreshArray = [array copy];
	}
	return self;
}

- (int)groupIndex
{
	return group;
}

- (int)group
{
	return group;
}

- (id)indexes
{
    return self;
}

- (int)lastIndex
{
	return index;
}

- (int)count
{
	return 1;
}

- (id)indexGreaterThanIndex:(int)i
{
	return nil;
}

- (void)setLastIndex:(int)i
{
	return;
}

- (bool)containsIndex:(int)_index
{
	int i, count = [refreshArray count];
	for (i = 0; i < count; i++) {
		NSNumber * obj = (NSNumber*)[refreshArray objectAtIndex:i];
		if ([obj intValue] == _index) {
			return YES;
		}
	}
	return NO;
}

- (NSRange)range
{
	NSRange r;
    r.location = index;
    r.length = range;
    return r;
}

@end
